package com.vanke.devops.domain.manager.docker;

import com.github.dockerjava.api.model.Container;
import com.github.dockerjava.api.model.Info;
import com.vanke.devops.domain.manager.docker.extend.model.Node;
import com.vanke.devops.domain.manager.docker.extend.model.Service;
import com.vanke.devops.domain.manager.docker.extend.model.Task;

import java.util.List;

/**
 * @author 陈景阳
 * @since 2018/4/1
 */
public interface DockerManager {
    /**
     * docker ps
     * @param ip IP
     * @return container list
     */
    List<Container> ps(String ip);

    /**
     * docker stats
     * @param ip ip
     */
    void  stats(String ip);

    /**
     * docker service ls
     * @param ip IP
     * @return service list
     */
    List<Service> services(String ip);

    /**
     * docker service inspect
     * @param ip IP
     * @param id service id
     * @return service
     */
    Service service(String ip,String id);

    /**
     * docker service ls | grep service_name
     * @param ip IP
     * @param name service_name
     * @return service
     */
    List<Service> withNameServices(String ip,String name);

    /**
     * docker service ps service_name
     * @param ip IP
     * @param serviceName service_name
     * @return tast list
     */
    List<Task> withServiceNameTasks(String ip,String serviceName);

    /**
     * docker node ls
     * @param ip IP
     * @return node list
     */
    List<Node> nodes(String ip);

    /**
     * docker info
     * @param ip IP
     * @return node info
     */
    Info info(String ip);
}
